Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resume suspended VMs without explicit --suspendable flag #540

Merged
merged 2 commits into from
Jul 7, 2023

Conversation

fkorotkov
Copy link
Contributor

No description provided.

@fkorotkov fkorotkov requested a review from edigaryev as a code owner July 6, 2023 20:04
@fkorotkov fkorotkov enabled auto-merge (squash) July 6, 2023 20:06
@fkorotkov fkorotkov merged commit d2ed4ef into main Jul 7, 2023
@fkorotkov fkorotkov deleted the suspend-improvements branch July 7, 2023 07:38
@Jon889
Copy link

Jon889 commented Oct 4, 2023

@fkorotkov is there a way to have a VM run ephemerally in that it will restore from the saved state but not save the state at the end. Then the next time the VM runs it will restore from the same/original saved state

@fkorotkov
Copy link
Contributor Author

@Jon889 you can clone a VM into a temporary one which is very fast and will clone the state. Then you can run this temporary VM and delete it once not needed anymore.

@Jon889
Copy link

Jon889 commented Oct 4, 2023

@fkorotkov Ah I thought that would invalidate the snapshot, as then multiple machines could be run. Also is it not possible to use snapshots with mounted directories? I get Failed to suspend the VM: Invalid virtual machine configuration. Unsupported directory sharing device in configuration. in which case it seems like tart shouldn't allow --suspendable and --dir to be used together

@fkorotkov
Copy link
Contributor Author

fkorotkov commented Oct 4, 2023

Sees you can resume a suspended VM with a mounted directory though. So you can run a suspendable VM without a mount, configure it and suspend. Then resume it again but this time with a mounted directory. The only part that is failing is the actual suspending of a VM with a mounted directory.

Adding the validation in #623

@Jon889
Copy link

Jon889 commented Oct 11, 2023

@fkorotkov Do you think there is any way around not being able to use suspendible VMs with mounted directories? macOS should have the ability to do it as USB drives can be plugged in and out without any notice.

@edigaryev
Copy link
Collaborator

@fkorotkov Do you think there is any way around not being able to use suspendible VMs with mounted directories? macOS should have the ability to do it as USB drives can be plugged in and out without any notice.

Unfortunately Virtualization.Framework does not support mounting USB drives yet, see #139 and utmapp/UTM#3778 for more details.

Mounting a block device could be an option, but a quick test shows that it also works incorrectly because the guest seems to be overwriting the host's device state/file table on resume from snapshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants